package cn.tedu.yxcar.product.pojo.dto.user;

import cn.tedu.yxcar.product.common.validation.RegExpressions;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * 添加用户的DTO类
 *
 * @author java@tedu.cn
 * @version 0.0.1
 */
@Data
public class UserAddNewDTO implements RegExpressions {


    /**
     * 验证不通过时的提示文本的前缀
     */
    private static final String MESSAGE_PREFIX = "登录失败！";

    /**
     * 用户名
     */
    @ApiModelProperty(value = "注册用户名", name = "username", example = "jackson", required = true)
    @NotNull(message = MESSAGE_PREFIX + "用户名不允许为空！")
    @Pattern(regexp = REGEXP_ADMIN_USERNAME, message = MESSAGE_PREFIX + MESSAGE_ADMIN_USERNAME)
    private String username;

    /**
     * 密码（原文）
     */
    @ApiModelProperty(value = "登录密码", name = "password", example = "123456", required = true)
    @NotNull(message = MESSAGE_PREFIX + "密码不允许为空！")
    @Pattern(regexp = REGEXP_ADMIN_PASSWORD, message = MESSAGE_PREFIX + MESSAGE_ADMIN_PASSWORD)
    private String password;

    /**
     * 昵称
     */
    @ApiModelProperty(value = "昵称", name = "nickname", example = "jackson", required = true)
    @NotNull(message = MESSAGE_PREFIX + "昵称不允许为空！")
    private String nickname;

    @ApiModelProperty(value = "地址", name = "address", example = "浙江省宁波市海曙区古林布政", required = true)
    @NotNull(message = MESSAGE_PREFIX + "地址不允许为空！")
    private String address;

    /**
     * 手机号码
     */

    @ApiModelProperty(value = "手机号", name = "phone", example = "17633565416", required = true)
    @NotNull(message = MESSAGE_PREFIX + "手机不允许为空！")
    private String phone;

    private String idCard;

    /**
     * 电子邮箱
     */

    @ApiModelProperty(value = "邮箱", name = "email", example = "jackson@163.com", required = true)
    @NotNull(message = MESSAGE_PREFIX + "邮箱不允许为空！")
    private String email;

    /**
     * 头像URL
     */

    @ApiModelProperty(value = "头像", name = "avatar", example = "jackson.png", required = true)
    @NotNull(message = MESSAGE_PREFIX + "头像不允许为空！")
    private String avatar;


}